﻿using Furion.Schedule;
using StackExchange.Redis;
using WesWebCore;

namespace WesJob;

public class CounterJob : IJob
{
    private readonly IConnectionMultiplexer _redisConnection;

    public CounterJob(IConnectionMultiplexer redisConnection)
    {
        _redisConnection = redisConnection;
    }

    public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken)
    {
        var db = _redisConnection.GetDatabase();
        db.StringIncrement(RedisKeys.Counter);
    }
}
